/***************************************************************************
 *            crypt.c
 *
 *  dim. novembre 11 21:51:52 2012
 *  Copyright  2012  Esprit
 *  <anouar.chemek@esprit.tn>
 ****************************************************************************/
/*
 * crypt.c
 *
 * Copyright (C) 2012 - Esprit
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#include<stdio.h>
#include<crypt.h>





void cryptCesar(char Sms[],char CryptedSms[],int n)
{
	char current;
	int i=0;
	while(Sms[i]!='\0')
	{
		current=Sms[i];
		CryptedSms[i]=(int)current + n;
		i++;
	}

	CryptedSms[i]='\0';
	
}

void decryptCesar(char CryptedSms[],char Sms[],int n)
{
	int i=0;
	char current;
	while(CryptedSms[i]!='\0')
	{
		current=CryptedSms[i];
		Sms[i]=(int)current - n;
		i++;
	}

	Sms[i]='\0';
}

